﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApp1
{
    class Class1
    {
        public static readonly string link = "server=.;database=dbUser;uid=sa;pwd=123456.";
        public static DataTable Query(string sql)
        {
            SqlConnection connection = new SqlConnection(link);
            SqlDataAdapter adapter = new SqlDataAdapter(sql,connection);
            DataTable dt = new DataTable();
            connection.Open();
            adapter.Fill(dt);
            return dt;
        }
    }
}
